<template>
	<view class="all">
		<view class="content">
			<view class='title-box'>
				<view class="ApplicationTitle">申请信息</view>
			</view>
			<YSteps class="" color="#3881ce" backgroundColor="#3881ce" :lineNum="3" :infoList = "list" @topage="gotoAppliDetail"></YSteps>
		</view>
	</view>
</template>

<script>
	import { mapState,mapActions } from 'vuex'
	import YSteps from '../components/Y-Steps/Y-Steps.vue'
	import {uniBadge} from '@dcloudio/uni-ui'
	import {uniList} from '@dcloudio/uni-ui'
	import {uniCard} from '@dcloudio/uni-ui'
	// import YSteps from '../../components/Y-Steps/Y-Steps.vue'
	export default {
		components: {
		            YSteps
		},
		data() {
			return {
				list:[],
				tempList:[],
				Seehouseapplication:{
						
				}
			}
		},
		methods: {
			gotoAppliDetail(e){
				var pageContent = this.tempList[e]
				console.log(e)
				// uni.$emit('getAppliDetail',{'appliDetail':this.tempList[e]})
				
				uni.navigateTo({
					url:"/pages/mine/appliDetail?seehouseapplicationId="+this.tempList[e].seehouseapplicationId
				})
			},
			getLocalTime(nS) {     
			   return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');     
			}
		},
		computed:{
			...mapState(['user'])
		},
		mounted(){
			console.log(this.user.userId)
			this.$axios.post('getSeeHouseByuserid',this.qs.stringify({'seehouseapplicationApplyerid':this.user.userId}))
			.then((res)=>{
				console.log(res.data)
				this.tempList = res.data.allseehouse
				this.tempList.forEach(function(i,index){
					
					i.seehouseapplicationCreattime = (new Date(parseInt(i.seehouseapplicationCreattime))).toLocaleDateString();
					if(i.seehouseapplicationState == 0){
						i.seehouseapplicationState = "未同意"
						// console.log(i)
					}else{
						i.seehouseapplicationState = "已同意"
						// console.log(i)
					}
					if(i.seehouseapplicationHousestate == 0){
						i.seehouseapplicationHousestate = "未审核"
					}else{
						i.seehouseapplicationHousestate = "已审核"
					}
				})
				this.list = this.tempList
			})
			.catch(err => {
				console.log(err)
			})
		}
	}
</script>

<style lang="scss" scoped>
$color-primary: #3881ce;
button[type="primary"]{
	background-color: $color-primary;
	border-radius: 0;
	font-size: 34upx;
	margin-top: 60upx;
}

.content{
	padding: 60rpx 60rpx 60rpx;
	border-color: #3881CE;
	border-width: 3rpx;
	// background-color: #F1F1F1;
}
.title-box{
	width: 90%;
	height: 35px;
	// background-color: #F3F3F3;
	margin-bottom: 10px;
	margin-top: 15px;
}
.ApplicationTitle{
	margin-bottom: 50upx;
	padding: 0;
	text-align: center;
	font-size: 30px;
	color: #666666;
}

</style>
